/**
 * Copyright(C) 2012 Luvina Software Company
 *
 * MstJapanDaoImpl.java, 7/1/2013, bacdv
 */
package net.luvina.manageuser.dao.impl;

import java.util.List;

import org.hibernate.HibernateException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;
import org.springframework.stereotype.Repository;

import net.luvina.manageuser.dao.MstJapanDao;
import net.luvina.manageuser.hibernate.MstJapan;

/**
 * MstJapanDaoImpl
 *
 * @author bacdv
 *
 */
@Repository("mstJapanDao")
public class MstJapanDaoImpl extends GenericDaoImpl<MstJapan, Integer>
		implements MstJapanDao {

	public MstJapanDaoImpl() {
		super(MstJapan.class);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see net.luvina.manageuser.dao.MstJapanDao#getListJapan()
	 */
	@SuppressWarnings("unchecked")
	public List<MstJapan> getListJapan() {
		HibernateCallback callback = new HibernateCallback() {
			public Object doInHibernate(Session session)
					throws HibernateException {
				Query query = session.createQuery("FROM MstJapan ");
				return (List<MstJapan>) query.list();
			}
		};
		return (List<MstJapan>) getHibernateTemplate().execute(callback);
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see
	 * net.luvina.manageuser.dao.MstJapanDao#existMstJapan(java.lang.String)
	 */
	public boolean existMstJapan(String str) {

		return false;
	}

}
